package hu.debrecen.adastra.card.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import com.google.common.collect.Lists;

public final class SocailUserDetailsService implements UserDetailsService {

	private static final Logger LOGGER = LoggerFactory.getLogger(SocailUserDetailsService.class);

	@Override
	public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {
		SocailUserDetailsService.LOGGER.debug("load user by username({})", username);
		return new User(username, username, Lists.newArrayList(new SimpleGrantedAuthority("ROLE_USER")));
	}
}